package net.sunofbeach.blog.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import net.sunofbeach.blog.pojo.Article;
import net.sunofbeach.blog.pojo.query.ArticleQuery;
import net.sunofbeach.blog.response.Result;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Bing
 * @since 2021-11-24
 */
public interface ArticleService extends IService<Article> {

    /**
     * 条件分页查询文章
     * @param pageParam
     * @param query
     * @return
     */
    IPage<Article> selectPage(Page<Article> pageParam, ArticleQuery query);

    /**
     * 逻辑删除文章
     * @param articleId
     * @param stateCode
     * @return
     */
    Result updateStatus(String articleId, String stateCode);

    /**
     * 根据ID查询文章详情
     * @param articleId
     * @return
     */
    Result getByArticleId(String articleId);


    /**
     * 文章推荐
     * @param articleId
     * @param size
     * @return
     */
    Result listRecommendArticle(String articleId, int size);


    /**
     * 管理员新增文章
     * @param article
     * @return
     */
    Result addArticle(Article article);

}
